Stop cursor blink after blink-cursor-blinks (10), stop timers when not blinking.
authorJan D. <jan.h.d@swipnet.se>
Tue, 16 Jul 2013 11:41:06 +0000 (13:41 +0200)
committerJan D. <jan.h.d@swipnet.se>
Tue, 16 Jul 2013 11:41:06 +0000 (13:41 +0200)
commitdba6cb06616bae33983f413ce1226a65ee1931b8
treea03c3f8eac9addf0901c16025858ad0e32dec741
parent6b7188e226417f4f0a60e71c240435927877eff7
Stop cursor blink after blink-cursor-blinks (10), stop timers when not blinking.

* etc/NEWS: Document blink-cursor-blinks and blink timers stopped.

* lisp/frame.el (blink-cursor-blinks): New defcustom.
(blink-cursor-blinks-done): New defvar.
(blink-cursor-start): Set blink-cursor-blinks-done to 1.
(blink-cursor-timer-function): Check if number of blinks has been
done on X and NS.
(blink-cursor-suspend, blink-cursor-check): New defuns.

* src/frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions.
(Fhandle_switch_frame): Call Fhandle_focus_in.
(syms_of_frame): defsubr handle-focus-in/out.

* src/keyboard.c (Qfocus_in, Qfocus_out): New static objects.
(make_lispy_focus_in, make_lispy_focus_out): Declare and define.
(kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no
switch frame event is made.  Check ! NILP (event->arg) if X11 (moved
from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11
and there is a focused frame.
(head_table): Add focus-in and focus-out.
(keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map,
bind to handle-focus-in/out.

* src/nsterm.m (windowDidResignKey): If this is the focused frame, generate
FOCUS_OUT_EVENT.

* src/termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT.

* src/xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT.
Set event->arg to Qt if switch-event shall be generated.
Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
etc/ChangeLog
etc/NEWS
lisp/ChangeLog
lisp/frame.el
src/ChangeLog
src/frame.c
src/keyboard.c
src/nsterm.m
src/termhooks.h
src/xterm.c